<?php

class EphotoModel extends Model {
/*	function insert($field){
		mkdir("img/".$field['username'],0777);
		
		//save uploaded file
		if ($field["pp"]["error"] > 0){
			//do nothing
		}else{
			if (file_exists("img/" .$field['username'].'/'.$field["pp"]["name"])) {
				echo $field["pp"]["name"] . " already exists. ";
			}
			else{
				move_uploaded_file($field["pp"]["tmp_name"],"img/" .$field['username'].'/'. $field["pp"]["name"]);
				$pict_url = "img/" .$field['username'].'/'. $field["pp"]["name"];
			}
		}
		
		//do the query
		$insert_string = "'".$field['fullname']."','".$field['username']."','".$field['password']."','".$field['tgllahir']."','".$field['email']."','".$pict_url."',".$field['gender'].",'".$field['kota']."'";
		$this->query('insert into user (Fullname,Username,Password,Tgllahir,Email,Pp,Gender,Kota) values ('.$insert_string.')');
	}*/
}
